]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Only enable internal commands if developer_tools is true
authorColin Walters <walters@verbum.org>
Mon, 14 Sep 2009 17:45:49 +0000 (13:45 -0400)
committerColin Walters <walters@verbum.org>
Tue, 15 Sep 2009 20:14:36 +0000 (16:14 -0400)
'r' is a bit too accidentally-hittable for outside of developer usage.
However it will still be enabled when developer_tools is true.

https://bugzilla.gnome.org/show_bug.cgi?id=595116

js/ui/runDialog.js

index 67d5b8b4fbc409b45de6d03f96378fa4ce19f4b9..9e3209288903c062e0d54074d9ac6afe5cb5be24 100644 (file)
@@ -34,6 +34,13 @@ RunDialog.prototype = {
     _init : function() {
         this._isOpen = false;
 
+        let gconf = Shell.GConf.get_default();
+        gconf.connect('changed', Lang.bind(this, function (gconf, key) {
+            if (key == 'development_tools')
+                this._enableInternalCommands = gconf.get_bool('development_tools');
+        }));
+        this._enableInternalCommands = gconf.get_boolean('development_tools');
+
         this._internalCommands = { 'lg':
                                    Lang.bind(this, function() {
                                        // Run in an idle to avoid recursive key grab problems
@@ -142,7 +149,11 @@ RunDialog.prototype = {
     },
 
     _run : function(command) {
-        let f = this._internalCommands[command];
+        let f;
+        if (this._enableInternalCommands)
+            f = this._internalCommands[command];
+        else
+            f = null;
         if (f) {
             f();
         } else if (command) {